#include "log_manager.hpp"
#include "ProcessMgr/process_manager.hpp"

int main() {

    // 获取 LogManager 的单例实例
    LogManager& logManager = LogManager::getInstance("log.txt");

    // 使用单例实例进行日志记录、存储和检索
    logManager.log(LogManager::LogLevel::INFO, "This is an information message.");
    logManager.log(LogManager::LogLevel::WARNING, "This is a warning message.");
    logManager.log(LogManager::LogLevel::ERROR, "This is an error message.");




    logManager.store("This is a message directly stored in the log.");

    logManager.search("error");

    // 测试进程管理器功能
    ProcessManager& processManager = ProcessManager::getInstance();

    processManager.addProcess("Process1", "/bin/echo", {"Hello from Process1"});
    processManager.addProcess("Process2", "/bin/echo", {"Hello from Process2"});

    processManager.startProcess("Process1");
    processManager.startProcess("Process2");

    std::this_thread::sleep_for(std::chrono::seconds(5));

    processManager.stopProcess("Process1");

    return 0;
}